{% extends 'default/base.html' %}
{% block content %}        {% load static %}

    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-lg-10">
            <h2>代码仓库列表 | CodeRep List.</h2>
        </div>
        <div class="col-lg-2">
        </div>
    </div>
    <style>
        .wrapper {
            margin-top: 10px;
        }

        .wanghui {
            margin-top: 10px;
        }
    </style>
    <div class="wrapper">
        <div class="row">
            <div class="ibox float-e-margins">
                <div id="result">
                    <div class="ibox-content">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th>
                                    本地存放路径
                                </th>
                                <th>
                                    发布代码服务器
                                </th>
                                <th>
                                    codeFqdn
                                </th>
                                <th>
                                    操作
                                </th>
                            </tr>
                            </thead>
                            <tbody>
                            {% for gitcode in gitcode_obj_list %}
                                <tr>
                                    <td class="col-lg-3">
                                        {{ gitcode.code_path }}
                                    </td>
                                    <td class="col-lg-5">
                                     {{ gitcode.code_server  }}
                                    </td>
                                    <td>{{ gitcode.code_fqdn }}</td>
                                    <td class="col-lg-3">
                                        <div class="wanghui">

                                            <a href="{% url 'code_rep_update' pk=gitcode.pk %}"
                                               class="btn btn-xs btn-info ">修改</a>
                                            <a href="#" type="button"
                                               class="btn btn-xs btn-danger">删除</a>
                                        </div>
                                    </td>
                                </tr>
                            {% endfor %}
                            </tbody>
                        </table>
                        <div class="voilet_page">
                            {#分页#}
                            {% if request.user.is_superuser or request.session.fun_auth.add_project %}
                                <a href="{% url 'code_rep_create' %}" type="button" class="btn btn-info">添加代码仓库</a>
                            {% endif %}
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        $(function () {
            $(document).on("click", ".ajex_edit", function (e) {
                e.preventDefault();
                var url = $(this).attr("href");
                $.ajax({
                    type: "GET",
                    url: url
                }).done(function (data) {
                    $("#result").html(data);
                });
            });


        });
    </script>
{% endblock %}



